package com.lvcoding.spring5.annotation3x.config;

import com.lvcoding.spring5.annotation3x.bean.Customer;
import com.lvcoding.spring5.annotation3x.bean.User;
import com.lvcoding.spring5.annotation3x.injection.UserDao;
import com.lvcoding.spring5.annotation3x.injection.UserDaoImpl;
import com.lvcoding.spring5.annotation3x.injection.UserService;
import com.lvcoding.spring5.annotation3x.injection.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;

/**
 * @Description 描述
 * @Date 2020-07-23 4:39 下午
 * @Author wuyanshen
 */
//@ComponentScan(basePackages = "com.lvcoding.spring5.annotation3x.injection")
@ImportResource("application1.xml")
@Configuration
public class AppConfig5 {

    @Autowired
    private UserDao userDao;

    @Bean
    public UserService userService(){
        UserServiceImpl userService = new UserServiceImpl();
        userService.setUserDao(userDao);
        return userService;
    }
}
